<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: distancexform</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: distancexform</td>
      <td class="subheader-left"><a href="matlab:open distancexform">View code for distancexform</a></td>
    </tr>
  </table>
<h1>distancexform</h1><p><span class="helptopic">Distance transform of occupancy grid</span></p><p>
<strong>d</strong> = <span style="color:red">distancexform</span>(<strong>world</strong>, <strong>goal</strong>) is the distance transform of the occupancy
grid <strong>world</strong> with respect to the specified goal point <strong>goal</strong> = [X,Y].  The
elements of the grid are 0 from free space and 1 for occupied.

</p>
<p>
<strong>d</strong> = <span style="color:red">distancexform</span>(<strong>world</strong>, <strong>goal</strong>, <strong>metric</strong>) as above but specifies the distance
metric as  either 'cityblock' or 'Euclidean'

</p>
<p>
<strong>d</strong> = <span style="color:red">distancexform</span>(<strong>world</strong>, <strong>goal</strong>, <strong>metric</strong>, <strong>show</strong>) as above but shows an animation
of the distance transform being formed, with a delay of <strong>show</strong> seconds between
frames.

</p>
<h2>Notes</h2>
<ul>
  <li>The Machine Vision Toolbox function imorph is required.</li>
  <li>The goal is [X,Y] not MATLAB [row,col]</li>
</ul>
<h2>See also</h2>
<p>
<a href="matlab:doc imorph">imorph</a>, <a href="matlab:doc DXform">DXform</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2012 Peter Corke.</p>
</body></html>